package com.rzhd.coursepatriarch.common.utils.rxbus;

import android.support.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * @author yql
 * @date: 2018/7/11.
 */
public class RxBusBaseMessage {

    @IntDef({EventCode.EVENT_CODE_LOGOUT,
            EventCode.EVENT_CODE_LOGIN,
            EventCode.EVERNT_CODE_MINE_INFO,
            EventCode.EVENT_CODE_NOTIFY_MESSAGE_NUMBER,
            EventCode.TO_LOGIN_PAGE_TOKEN,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface EventCode {
        /**
         * 退出登录
         */
        int EVENT_CODE_LOGOUT = 99;
        /**
         * 登录
         */
        int EVENT_CODE_LOGIN = 100;

        /**
         * 个人信息中更改信息后刷新数据
         */
        int EVERNT_CODE_MINE_INFO = 101;

        /**
         * 刷新消息个数
         */
        int EVENT_CODE_NOTIFY_MESSAGE_NUMBER = 102;

        /**
         * token失效
         */
        int TO_LOGIN_PAGE_TOKEN = 103;

    }

    private int code;
    private Object mObject;

    public RxBusBaseMessage() {
    }

    public RxBusBaseMessage(@EventCode int code, Object object) {
        this.code = code;
        mObject = object;
    }

    public @EventCode
    int getCode() {
        return code;
    }

    public Object getObject() {
        return mObject;
    }

}
